<?php
require_once 'config.php';

/* 根据uId查找书评和评论
 * @param uId
 * @review array
 * @autor zhangmanya 2020.6.8
 *  */
function getReview($uId){
    $sqlGet="SELECT * FROM Review WHERE uId='$uId'";
    $result=getQuery($sqlGet);
    return $result;
}

//根据书籍编号查找书本
function getBookname($bookId){
    $sqlGet="SELECT * FROM book WHERE bookId='$bookId'";
    $result=getQuery($sqlGet);
    return $result;
}

//根据用户Id查找评论
function findreply($uId){
    $sqlGet="SELECT * FROM reply WHERE uId='$uId'";
    $result=getQuery($sqlGet);
    return $result;
}
// var_dump(findreply(1));

//根据评论查找书评
function findReviewfromreply($replyId){
    $sqlGet="SELECT * FROM review,reply WHERE review.reviewId=reply.reviewId and $replyId='$replyId'";
    $result=getQuery($sqlGet);
    return $result;
    
}
// var_dump(findReviewfromreply(1));
?>